package com.service.impl;

import com.mapper.LoginMapper;
import com.pojo.Account;
import com.pojo.RightClassOne;
import com.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    public Account LoginReturnAccountMsgByUsernameAndPassword(Account account) {
        return loginMapper.LoginReturnAccountMsgByUsernameAndPassword(account);
    }

    public List<RightClassOne> thisAccountAllRightClassById(Long roleId) {
        return loginMapper.thisAccountAllRightClassById(roleId);
    }

    public List<RightClassOne> thisAccountRightDoByRoleId(Long i) {
        return loginMapper.thisAccountRightDoByRoleId(i);
    }

    public boolean addLoginTime(Account account) {
        if(loginMapper.addLoginTime(account)>0){
            return true;
        }
        return false;
    }

    public Account getAccountByNameAndPhone(Account account) {
        return loginMapper.getAccountByNameAndPhone(account);
    }

    public List<RightClassOne> thisAccountRightFrontStageList(Long roleId) {
        return loginMapper.thisAccountRightFrontStageList(roleId);
    }

}
